package service.Impl;

import dao.NoticeDao;
import org.springframework.beans.factory.annotation.Autowired;
import pojo.Notice;
import service.NoticeService;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class NoticeServiceimpl implements NoticeService {

    @Autowired
    private NoticeDao noticeDao;

    @Override
    public List<Notice> findAllNotices() {
        return noticeDao.findAllNotices();
    }

    @Override
    public Notice findNoticeById(Integer id) {
        return noticeDao.findNoticeById(id);
    }

    @Override
    public List<Notice> findNoticesByTitle(String title) {
        return noticeDao.findNoticesByTitle(title);
    }
    @Override
    public int addNotice(Notice notice) {
        return noticeDao.insertNotice(notice);
    }

    @Override
    public int updateNotice(Notice notice) {
        return noticeDao.updateNotice(notice);
    }

    @Override
    public int deleteNotice(Integer id) {
        return noticeDao.deleteNotice(id);
    }
}

